const route = require('../../common/utils/navUtils.js')
const toast = require('../../common/utils/toast.js')
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    list: Array
  },

  /**
   * 组件的初始数据
   */
  data: {
    selected: 0,
    color: "#7A7E83",
    selectedColor: "#3cc51f",
  },

  /**
   * 组件的方法列表
   */
  methods: {
    switchTab(e) {
      toast.showLoading('加载中')
      const data = e.currentTarget.dataset
      const url = data.path
      console.log('data:', data.index + '/nurl:', url);
      route.relTo(url)
      toast.hideLoading()
      this.setData({
        selected: data.index,
      })

    }
  }
})